#ifndef __MJBOTS_H
#define __MJBOTS_H

#include "main.h"

// 此处根据电机的个数和ID号，自定义电机的名字
typedef enum
{
    MOTOR1 = 1,
    MOTOR2,
    MOTOR3,
    MOTOR4,
    MOTOR5,
		// ......
}motor_e;

void set_dq_volt(motor_e motor,int16_t volt);
void set_torque(motor_e motor,int16_t torque);
void set_velocity(motor_e motor,int16_t vel, int16_t torque);
void set_position_32(motor_e motor, int32_t pos, int32_t vel, int32_t torque);
void set_position_32_kpkd(motor_e motor, int32_t pos, int32_t vel, int32_t torque, float kp, float kd);
void set_velocity_32(motor_e motor, int32_t vel, int32_t torque);
void set_position(motor_e motor, int16_t pos, int16_t vel, int16_t torque);
void send_raw_cmd(motor_e motor,uint8_t *, uint16_t);
void parse_mjbots(uint8_t* RxData, uint16_t length);
void request_motor_status(motor_e motor);
float get_motor_mode(motor_e motor);
float get_motor_position(motor_e motor);
float get_motor_velocity(motor_e motor);
float get_motor_torque(motor_e motor);
void set_max_velocity(motor_e motor, int16_t max_vel);
void set_max_acc(motor_e motor, int16_t max_acc);
uint8_t is_get_motor_status(motor_e motor);

#endif
